﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GameSchool.Models;
using GameSchool.Models.ViewModels;

namespace GameSchool.Models.Interfaces
{
/// <summary>
/// Interfaces.
/// ------------------------------------------
/// Interfaces hold function declerations for all avaliable Repo functions.
/// The implementation itself depends on what sort of a dataconnection we're actually working with - so we can't tell until we know.
/// By using interfaces the whole unit testing process is made easier since both the actual Repo an the unit testing Repo simply inherit the interface
/// and implement it to work with the data being used.
/// 
/// Avaliable Interfaces:
///     - IUserRepository
///     - ICourseRepository
///     - IPointsRepository
///     - INewsRepositor
///     - ICommentLikeRepository
///     - ILectureRepository
///     - IHandInRepository
///     - ILevelRepository
///     
/// The interfaces do not have an edit function since it is sufficient to simply use GetByID on the item to be edited and then saving the changes.
/// </summary>


    //Done - ÓLi - Vantar GetUserAssignments!
    interface IUserRepository
    {
         void AddUserProfile(UserProfileModel u);
         UserProfile GetUserProfileByID(Guid? uID);
          
         //IQueryable<UserProfile> GetUsersByCourse(int? cID);
     
        // IQueryable<Assignment> GetUserAssignments(int? uID);
         void Save();

    }


    //Done - Gaui
    public interface ICourseRepository
    {
         void AddCourse(Course c);
         IQueryable<UserProfile> GetUsersByCourse(int? cID);
         Course GetCourseByID(int? cID);
         IQueryable<Course> GetCourses();
         IQueryable<Course> GetCoursesByUserID(int? uID);

         void DeleteCourse(int? cID);

         void Save();

    }

    interface IPointsRepository
    {
         void AddPoints(int? normalPoints, int? bonusPoints);
         int GetPoinsByUserID(int? uID);
         int GetPointsByCourseID(int? cID);
         int GetPointsByLevelID(int? levID);
         int GetPointsByAssignmentID(int? aID);
         void AddToScoreTable(Score scores);
         int GetBonusPointsByUserID(int? uID);
    }

    //Done víðir
    public interface INewsRepository
    {
         IQueryable<NewsItem> GetNews();
         NewsItem GetNewsByID(int? nID);
         void AddNews(NewsItem n);
         void DeleteNews(int? nID);
         void Save();
    }
    //Done Víðir
    interface ICommentLikeRepository
    {
        IQueryable<Comment> GetComments(int? lectureID);
		void AddComment(Comment c);
		void DeleteComment(int? cID);
		
		IQueryable<Like> GetLikes(int? cID);
		void AddLike(Like l);
		void DeleteLike(int? lID);
		
		void GiveCommentPoints(int? cID);
    }

    public interface IAssignmentRepository
    {
        AssignmentScore CheckIfCompletedByID(Guid uID, int? id);
        IQueryable<Assignment> GetAssignments();
        Assignment GetAssignmentByID(int? aID);
        void AddAssignment(Assignment a);
        void DeleteAssignment(int? aID);
    }

    //Done Gunni - 
    public interface ILectureRepository
    {
		void AddLecture(Lecture l);
		//Lecture GetLecturesByLevel(int? lID);
        IQueryable<Lecture> GetLectures();
		Lecture GetLectureByID(int? lID);
		void DeleteLecture(int? lID);
		void Save();
    }

    //Done Gunni
    public interface IHandInRepository
    {
		void AddHandIn(HandIn h);
        IQueryable<HandIn> GetHandIn();
		//IQueryable<HandIn> GetHandInByLevel(int? levelID);
		HandIn GetHandInByID(int? hID);
        void DeleteHandIn(int? hID);
		void Save();
    }

    //Done - Gunni
    interface ILevelRepository
    {
		void AddLevel(Level l);
		Level GetLevelsByCourseID(int? cID);
        IQueryable<Level> GetLevels();
		Level GetLevelByID(int? lID);
		void DeleteLevel(int? lID);
		void Save();
    }

    //InProgress - Óli
    interface IQuizRepository
    {
		void AddQuiz(Quiz q);
        void AddQuestion(Question que);
        void AddChoice(Choice c);
        void AddAnswer(Answer a);
       // void AddUserQuiz(UserQuiz uq);
        IQueryable<Question> GetQuestionsByQuizID(int? qID);
        IQueryable<Quiz> GetQuiz();
		IQueryable<Quiz> GetQuizByLevelID(int? lID);
		Quiz GetQuizByID(int? qID);
        void DeleteQuiz(int? qID);
		void Save();
    }
}
